let router = require('koa-router')();
const personal = require('./../controllers').personal;
const wechat = require('./../controllers').wechat;
const appointment = require('./../controllers').appointment;
const record = require('./../controllers').record;

router.get('/ensure/code/:mobile', wechat.sendEnsureCode);
router.post('/ensure/account', wechat.ensureAccount);
router.post('/sign', wechat.sign);

router.get('/personal/info/:code?', personal.myInfo);
router.get('/personal/task/:code?', personal.taskList);
router.get('/personal/more/task', personal.moreTask);
router.post('/activity/customer/confirm', personal.confirmTask);
router.post('/activity/customer/cancel', personal.cancelTask);

router.get('/personal/records/:code?', record.recordsList);
router.get('/personal/more/records', record.moreRecords);
router.get('/scheduler/list/:periodId', record.getSchedules);
router.get('/scheduler/more/list/:periodId', record.moreSchedules);

router.get('/accommodation/:id', appointment.getAccommodation);
router.get('/appoint/appointments/:code?', appointment.getAppointments);
router.get('/appoint/more/appointments', appointment.moreAppoints);
router.get('/appoint/doappoint', appointment.doAppointment);
router.post('/appointment/contacts', appointment.getContacts);
router.post('/appointment/appoint', appointment.newAppointment);

exports = module.exports = router;
